import request from '@/utils/request.ts'

// 查询床位列表 (分页)
export function selectPageBedRec(query) {
    return request({
        url: '/business/bedRec/selectPage',
        method: 'get',
        params: query
    })
}

// 查询床位列表 (不分页)
export function listBedRec(query) {
    return request({
        url: '/business/bedRec/list',
        method: 'get',
        params: query
    })
}

// 查询床位详细
export function getBedRec(bedId) {
    return request({
        url: '/business/bedRec/' + bedId,
        method: 'get'
    })
}

// 新增床位
export function addBedRec(data) {
    return request({
        url: '/business/bedRec',
        method: 'post',
        data: data
    })
}

// 换床
export function alterBedOk(data) {
    return request({
        url: '/business/bedRec/alterBedOk',
        method: 'post',
        data: data
    })
}

// 修改床位
export function updateBedRec(data) {
    return request({
        url: '/business/bedRec',
        method: 'put',
        data: data
    })
}

// 删除床位
export function delBedRec(bedId) {
    return request({
        url: '/business/bedRec/' + bedId,
        method: 'delete'
    })
}

// 获取护理单元床位对照
export function getDeptVsBedList(wardCode, orgId) {
    return request({
        url: '/business/bedRec/getDeptVsBedList/' + wardCode + '/' + orgId,
        method: 'get'
    })
}

// 通过visitId获取床位是否被占用，并进行分组
export function getBedRecGroup(wardCode, orgId) {
    return request({
        url: '/business/bedRec/getBedRecGroup/' + wardCode + '/' + orgId,
        method: 'get'
    })
}

// 查询护士站床位信息（包含患者信息）
export function listBedRecAndPatient(query) {
    return request({
        url: '/business/bedRec/listBedRecAndPatient',
        method: 'get',
        params: query
    })
}

// 查询切换患者信息选择框（包含患者信息）
export function listBedRecPatient(query) {
    return request({
        url: '/business/bedRec/listBedRecPatient',
        method: 'get',
        params: query
    })
}
// 撤销移入
export function cancelMoveInOk(query) {
    return request({
        url: '/business/bedRec/cancelMoveInOk',
        method: 'get',
        params: query
    })
}
